/*
 * TEXT BELOW IS USED AS SETTING FOR TOOLS *************************************
!!GlobalInfo
product: Pins v3.0
processor: LPC54606J512
package_id: LPC54606J512BD100
mcu_data: ksdk2_0
processor_version: 2.0.2
 * BE CAREFUL MODIFYING THIS COMMENT - IT IS YAML SETTINGS FOR TOOLS ***********
 */

#include "fsl_common.h"
#include "pin_mux.h"

/*FUNCTION**********************************************************************
 * 
 * Function Name : BOARD_InitBootPins
 * Description   : Calls initialization functions.
 * 
 *END**************************************************************************/
void BOARD_InitBootPins(void) {
    BOARD_InitPins();
}

#define PIO029_DIGIMODE_DIGITAL       0x01u   /*!< Select Analog/Digital mode.: Digital mode. */
#define PIO029_FILTEROFF_DISABLED     0x01u   /*!< Controls input glitch filter.: Filter disabled. No input filtering is done. */
#define PIO029_FUNC_ALT1              0x01u   /*!< Selects pin function.: Alternative connection 1. */
#define PIO029_INVERT_DISABLED        0x00u   /*!< Input polarity.: Disabled. Input function is not inverted. */
#define PIO029_OD_NORMAL              0x00u   /*!< Controls open-drain mode.: Normal. Normal push-pull output */
#define PIO029_SLEW_STANDARD          0x00u   /*!< Driver slew rate.: Standard mode, output slew rate control is enabled. More outputs can be switched simultaneously. */
#define PIO030_DIGIMODE_DIGITAL       0x01u   /*!< Select Analog/Digital mode.: Digital mode. */
#define PIO030_FILTEROFF_DISABLED     0x01u   /*!< Controls input glitch filter.: Filter disabled. No input filtering is done. */
#define PIO030_FUNC_ALT1              0x01u   /*!< Selects pin function.: Alternative connection 1. */
#define PIO030_INVERT_DISABLED        0x00u   /*!< Input polarity.: Disabled. Input function is not inverted. */
#define PIO030_OD_NORMAL              0x00u   /*!< Controls open-drain mode.: Normal. Normal push-pull output */
#define PIO030_SLEW_STANDARD          0x00u   /*!< Driver slew rate.: Standard mode, output slew rate control is enabled. More outputs can be switched simultaneously. */
#define PIO08_DIGIMODE_DIGITAL        0x01u   /*!< Select Analog/Digital mode.: Digital mode. */
#define PIO08_FILTEROFF_DISABLED      0x01u   /*!< Controls input glitch filter.: Filter disabled. No input filtering is done. */
#define PIO08_FUNC_ALT0               0x00u   /*!< Selects pin function.: Alternative connection 0. */
#define PIO08_INVERT_DISABLED         0x00u   /*!< Input polarity.: Disabled. Input function is not inverted. */
#define PIO08_OD_NORMAL               0x00u   /*!< Controls open-drain mode.: Normal. Normal push-pull output */
#define PIO08_SLEW_STANDARD           0x00u   /*!< Driver slew rate.: Standard mode, output slew rate control is enabled. More outputs can be switched simultaneously. */
#define PIO09_DIGIMODE_DIGITAL        0x01u   /*!< Select Analog/Digital mode.: Digital mode. */
#define PIO09_FILTEROFF_DISABLED      0x01u   /*!< Controls input glitch filter.: Filter disabled. No input filtering is done. */
#define PIO09_FUNC_ALT0               0x00u   /*!< Selects pin function.: Alternative connection 0. */
#define PIO09_INVERT_DISABLED         0x00u   /*!< Input polarity.: Disabled. Input function is not inverted. */
#define PIO09_OD_NORMAL               0x00u   /*!< Controls open-drain mode.: Normal. Normal push-pull output */
#define PIO09_SLEW_STANDARD           0x00u   /*!< Driver slew rate.: Standard mode, output slew rate control is enabled. More outputs can be switched simultaneously. */
#define PIO126_DIGIMODE_DIGITAL       0x01u   /*!< Select Analog/Digital mode.: Digital mode. */
#define PIO126_FILTEROFF_DISABLED     0x01u   /*!< Controls input glitch filter.: Filter disabled. No input filtering is done. */
#define PIO126_FUNC_ALT0              0x00u   /*!< Selects pin function.: Alternative connection 0. */
#define PIO126_INVERT_DISABLED        0x00u   /*!< Input polarity.: Disabled. Input function is not inverted. */
#define PIO126_OD_NORMAL              0x00u   /*!< Controls open-drain mode.: Normal. Normal push-pull output */
#define PIO126_SLEW_STANDARD          0x00u   /*!< Driver slew rate.: Standard mode, output slew rate control is enabled. More outputs can be switched simultaneously. */

/*
 * TEXT BELOW IS USED AS SETTING FOR TOOLS *************************************
BOARD_InitPins:
- options: {callFromInitBoot: 'true', coreID: core0, enableClock: 'true'}
- pin_list:
  - {pin_num: '82', peripheral: FLEXCOMM0, signal: RXD_SDA_MOSI, pin_signal: PIO0_29/FC0_RXD_SDA_MOSI/CTIMER2_MAT3/SCT0_OUT8/TRACEDATA(2), invert: disabled, glitch_filter: disabled,
    slew_rate: standard, open_drain: disabled}
  - {pin_num: '95', peripheral: FLEXCOMM0, signal: TXD_SCL_MISO, pin_signal: PIO0_30/FC0_TXD_SCL_MISO/CTIMER0_MAT0/SCT0_OUT9/TRACEDATA(1), invert: disabled, glitch_filter: disabled,
    slew_rate: standard, open_drain: disabled}
  - {pin_num: '64', peripheral: GPIO, signal: 'PIO0, 8', pin_signal: PIO0_8/FC3_SSEL3/SD_CMD/FC5_RXD_SDA_MOSI/SWO/PDM1_DATA/EMC_D(6), invert: disabled, glitch_filter: disabled,
    slew_rate: standard, open_drain: disabled}
  - {pin_num: '65', peripheral: GPIO, signal: 'PIO0, 9', pin_signal: PIO0_9/FC3_SSEL2/SD_POW_EN/FC5_TXD_SCL_MISO/SCI1_IO/EMC_D(7), invert: disabled, glitch_filter: disabled,
    slew_rate: standard, open_drain: disabled}
  - {pin_num: '63', peripheral: GPIO, signal: 'PIO1, 26', pin_signal: PIO1_26/FC2_CTS_SDA_SSEL0/SCT0_OUT3/CTIMER0_CAP3/UTICK_CAP1/EMC_A(8), invert: disabled, glitch_filter: disabled,
    slew_rate: standard, open_drain: disabled}
 * BE CAREFUL MODIFYING THIS COMMENT - IT IS YAML SETTINGS FOR TOOLS ***********
 */

/*FUNCTION**********************************************************************
 *
 * Function Name : BOARD_InitPins
 * Description   : Configures pin routing and optionally pin electrical features.
 *
 *END**************************************************************************/
void BOARD_InitPins(void) { /* Function assigned for the Core #0 (ARM Cortex-M4) */
  CLOCK_EnableClock(kCLOCK_Iocon);                           /* Enables the clock for the IOCON block. 0 = Disable; 1 = Enable.: 0x01u */

  IOCON->PIO[0][29] = ((IOCON->PIO[0][29] &
    (~(IOCON_PIO_FUNC_MASK | IOCON_PIO_INVERT_MASK | IOCON_PIO_DIGIMODE_MASK | IOCON_PIO_FILTEROFF_MASK | IOCON_PIO_SLEW_MASK | IOCON_PIO_OD_MASK))) /* Mask bits to zero which are setting */
      | IOCON_PIO_FUNC(PIO029_FUNC_ALT1)                     /* Selects pin function.: PORT029 (pin 82) is configured as FC0_RXD_SDA_MOSI */
      | IOCON_PIO_INVERT(PIO029_INVERT_DISABLED)             /* Input polarity.: Disabled. Input function is not inverted. */
      | IOCON_PIO_DIGIMODE(PIO029_DIGIMODE_DIGITAL)          /* Select Analog/Digital mode.: Digital mode. */
      | IOCON_PIO_FILTEROFF(PIO029_FILTEROFF_DISABLED)       /* Controls input glitch filter.: Filter disabled. No input filtering is done. */
      | IOCON_PIO_SLEW(PIO029_SLEW_STANDARD)                 /* Driver slew rate.: Standard mode, output slew rate control is enabled. More outputs can be switched simultaneously. */
      | IOCON_PIO_OD(PIO029_OD_NORMAL)                       /* Controls open-drain mode.: Normal. Normal push-pull output */
    );
  IOCON->PIO[0][30] = ((IOCON->PIO[0][30] &
    (~(IOCON_PIO_FUNC_MASK | IOCON_PIO_INVERT_MASK | IOCON_PIO_DIGIMODE_MASK | IOCON_PIO_FILTEROFF_MASK | IOCON_PIO_SLEW_MASK | IOCON_PIO_OD_MASK))) /* Mask bits to zero which are setting */
      | IOCON_PIO_FUNC(PIO030_FUNC_ALT1)                     /* Selects pin function.: PORT030 (pin 95) is configured as FC0_TXD_SCL_MISO */
      | IOCON_PIO_INVERT(PIO030_INVERT_DISABLED)             /* Input polarity.: Disabled. Input function is not inverted. */
      | IOCON_PIO_DIGIMODE(PIO030_DIGIMODE_DIGITAL)          /* Select Analog/Digital mode.: Digital mode. */
      | IOCON_PIO_FILTEROFF(PIO030_FILTEROFF_DISABLED)       /* Controls input glitch filter.: Filter disabled. No input filtering is done. */
      | IOCON_PIO_SLEW(PIO030_SLEW_STANDARD)                 /* Driver slew rate.: Standard mode, output slew rate control is enabled. More outputs can be switched simultaneously. */
      | IOCON_PIO_OD(PIO030_OD_NORMAL)                       /* Controls open-drain mode.: Normal. Normal push-pull output */
    );
  IOCON->PIO[0][8] = ((IOCON->PIO[0][8] &
    (~(IOCON_PIO_FUNC_MASK | IOCON_PIO_INVERT_MASK | IOCON_PIO_DIGIMODE_MASK | IOCON_PIO_FILTEROFF_MASK | IOCON_PIO_SLEW_MASK | IOCON_PIO_OD_MASK))) /* Mask bits to zero which are setting */
      | IOCON_PIO_FUNC(PIO08_FUNC_ALT0)                      /* Selects pin function.: PORT08 (pin 64) is configured as PIO0_8 */
      | IOCON_PIO_INVERT(PIO08_INVERT_DISABLED)              /* Input polarity.: Disabled. Input function is not inverted. */
      | IOCON_PIO_DIGIMODE(PIO08_DIGIMODE_DIGITAL)           /* Select Analog/Digital mode.: Digital mode. */
      | IOCON_PIO_FILTEROFF(PIO08_FILTEROFF_DISABLED)        /* Controls input glitch filter.: Filter disabled. No input filtering is done. */
      | IOCON_PIO_SLEW(PIO08_SLEW_STANDARD)                  /* Driver slew rate.: Standard mode, output slew rate control is enabled. More outputs can be switched simultaneously. */
      | IOCON_PIO_OD(PIO08_OD_NORMAL)                        /* Controls open-drain mode.: Normal. Normal push-pull output */
    );
  IOCON->PIO[0][9] = ((IOCON->PIO[0][9] &
    (~(IOCON_PIO_FUNC_MASK | IOCON_PIO_INVERT_MASK | IOCON_PIO_DIGIMODE_MASK | IOCON_PIO_FILTEROFF_MASK | IOCON_PIO_SLEW_MASK | IOCON_PIO_OD_MASK))) /* Mask bits to zero which are setting */
      | IOCON_PIO_FUNC(PIO09_FUNC_ALT0)                      /* Selects pin function.: PORT09 (pin 65) is configured as PIO0_9 */
      | IOCON_PIO_INVERT(PIO09_INVERT_DISABLED)              /* Input polarity.: Disabled. Input function is not inverted. */
      | IOCON_PIO_DIGIMODE(PIO09_DIGIMODE_DIGITAL)           /* Select Analog/Digital mode.: Digital mode. */
      | IOCON_PIO_FILTEROFF(PIO09_FILTEROFF_DISABLED)        /* Controls input glitch filter.: Filter disabled. No input filtering is done. */
      | IOCON_PIO_SLEW(PIO09_SLEW_STANDARD)                  /* Driver slew rate.: Standard mode, output slew rate control is enabled. More outputs can be switched simultaneously. */
      | IOCON_PIO_OD(PIO09_OD_NORMAL)                        /* Controls open-drain mode.: Normal. Normal push-pull output */
    );
  IOCON->PIO[1][26] = ((IOCON->PIO[1][26] &
    (~(IOCON_PIO_FUNC_MASK | IOCON_PIO_INVERT_MASK | IOCON_PIO_DIGIMODE_MASK | IOCON_PIO_FILTEROFF_MASK | IOCON_PIO_SLEW_MASK | IOCON_PIO_OD_MASK))) /* Mask bits to zero which are setting */
      | IOCON_PIO_FUNC(PIO126_FUNC_ALT0)                     /* Selects pin function.: PORT126 (pin 63) is configured as PIO1_26 */
      | IOCON_PIO_INVERT(PIO126_INVERT_DISABLED)             /* Input polarity.: Disabled. Input function is not inverted. */
      | IOCON_PIO_DIGIMODE(PIO126_DIGIMODE_DIGITAL)          /* Select Analog/Digital mode.: Digital mode. */
      | IOCON_PIO_FILTEROFF(PIO126_FILTEROFF_DISABLED)       /* Controls input glitch filter.: Filter disabled. No input filtering is done. */
      | IOCON_PIO_SLEW(PIO126_SLEW_STANDARD)                 /* Driver slew rate.: Standard mode, output slew rate control is enabled. More outputs can be switched simultaneously. */
      | IOCON_PIO_OD(PIO126_OD_NORMAL)                       /* Controls open-drain mode.: Normal. Normal push-pull output */
    );
}

/*******************************************************************************
 * EOF
 ******************************************************************************/
